{extend name='common@layout/seller' /}
{block name="left"}{include file='common/order_left'}{/block}
{block name="breadcrumb"}
<div class="ncsc-path"><i class="icon-desktop"></i>商家管理中心<i class="icon-angle-right"></i>订单物流<i class="icon-angle-right"></i>发货</div>
{/block}
{block name='content'}

<div class="tabmenu">
    {include file='common/submenu'}
    <a href="javascript:void(0)" class="ncsc-btn ncsc-btn-green" nc_type="dialog" dialog_title="新增地址" dialog_id="my_address_add"  uri="/?s=seller/deliver_set/daddress_add" dialog_width="550" title="新增地址">新增地址</a>
</div>
<div></div>
<table class="ncsc-default-table" >
  <thead>
    <tr>
      <th class="w70">是否默认</th>
      <th class="w90">联系人</th>
      <th class="tl">发货地址</th>
      <th class="w150">电话</th>
      <th class="w110">操作</th>
    </tr>
  </thead>
  <tbody>
    <?php if(!empty($address_list) && is_array($address_list)){?>
    <?php foreach($address_list as $key=>$address){?>
    <tr class="bd-line">
      <td>
        <label for="is_default_<?php echo $address['address_id'];?>"><input type="radio" id="is_default_<?php echo $address['address_id'];?>" name="is_default" <?php if ($address['is_default'] == 1) echo 'checked';?> value="<?php echo $address['address_id'];?>">
        默认</label>
      </td>
      <td><?php echo $address['seller_name'];?></td>
      <td class="tl"><?php echo $address['area_info'];?>&nbsp;<?php echo $address['address'];?></td>
      <td><span class="tel"><?php echo $address['telphone'];?></span> <br/>
      <td class="nscs-table-handle"><span><a href="javascript:void(0);" dialog_id="my_address_edit" dialog_width="640" dialog_title="编辑地址" nc_type="dialog" uri="/?s=seller/deliver_set/daddress_add&address_id=<?php echo $address['address_id'];?>" class="btn-blue"><i class="icon-edit"></i>
        <p>编辑</p>
        </a></span><span> <a href="javascript:void(0)" onclick="ajax_get_confirm('您确定要删除吗?', '/?s=seller/deliver_set/daddress_del&address_id=<?php echo $address['address_id'];?>');" class="btn-red"><i class="icon-trash"></i>
        <p>删除</p>
        </a></span></td>
    </tr>
    <?php }?>
    <?php }else{?>
    <tr>
      <td colspan="20" class="norecord"><div class="warning-option"><i class="icon-warning-sign"></i><span>暂无符合条件的数据记录</span></div></td>
    </tr>
    <?php }?>
  </tbody>
  <tfoot>
    <tr>
      <td colspan="20">&nbsp;</td>
    </tr>
  </tfoot>
</table>
<script src="/old/data/resource/js/common_select.js?{$Think.config.version_source}"></script> 
<script>
$(function (){
	$('input[name="is_default"]').on('change',function(){
		$.get('/?s=seller/deliver_set/daddress_default_set&address_id='+$(this).val(),function(result){})
	});
});
</script> 

{/block}
